A note in Trilium can own one or more attachments, which can be either images or files. These attachments can be displayed or linked within the note that owns them.

This can be especially useful to include dependencies for your scripts. The Weight Tracker shows how to use chartjs which is attached to the script note.

Each note exclusively owns its attachments, meaning attachments cannot be shared or linked from one note to another. If an attachment link is copied to a different note, the attachment itself is duplicated, and the copies are managed independently thereafter.

Attachments, especially image files, are the recommended method for embedding visuals in notes. It is important to link image attachments within the text of the owning note; otherwise, they will be automatically deleted after a configurable timeout period if not referenced.

Types of attachments

There are two different types of attachment:

The system attachments are displayed at the end of the attachments list, in a dedicated section (Generated by Trilium).

Attaching files from a text note

To attach files to a Text note and link them in its content, press the Attach file button in the Formatting toolbar, next to the image upload button, and select one or more files. The arrow beside the button lists the same action as Attach file as a link, followed by Attach and embed file, which embeds the files instead (see below). Both actions are also available as Attach file as a link and Attach and embed file in the Slash Commands.

Dragging a file that is not a picture from the file explorer onto the text also attaches it and inserts a link to it.

Acting on an attachment link

Right-clicking a link to an attachment shows the ways to open it, followed by actions on the attachment: opening it externally, downloading it, uploading a new revision, renaming or deleting it, and converting it into a note.

Links follow changes to their attachment: renaming it updates the title they show, and deleting it removes them from the text notes open for editing at that moment. Converting it into a note turns its links into links to the new note.

Embedding an attachment

An attachment can be shown in the text instead of linked, the way Include Note shows a note: a picture is displayed, a PDF, a video or a document is previewed, and a code or text file is shown with syntax highlighting. An embedded code file can also be edited in place (see Editing an include in place in Include Note).

An embed follows its attachment like a link does. Converting the attachment into a note turns the embed into an included note. In a shared note, an embedded picture is displayed with its caption, and any other attachment, or a picture in a Tiny embed, appears as a link to download it.

Converting notes to attachments

File notes can be easily converted to attachments of the parent note.

To do so:

Attachment previews

Attachments share the same content preview for images, videos, PDFs, etc. as the File note type.